<!DOCTYPE html>
<html>
<head>
  <style>
pre {
  background-color: #eee;
  padding: 0.75em 1.5em;
  font-size: 12px;
  font-family: "Lucida Console", "DejaVu Sans Mono", Courier, monospace;
  border: 1px solid #ddd;
}
body {
    background-color: #0066FF;
}
.style1 {
    font-family: Arial, Helvetica, sans-serif
}
.style2 {
    font-family: Arial, Helvetica, sans-serif;
    color: #FFFFFF;
}
  </style>
  <title>ADOdb Database Abstraction Library for PHP</title>
  <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body>
<table width="986" cellpadding=8 border="2" align="center" bordercolor="#999999">
  <tbody>
    <tr>
      <td bgcolor="#FFFFFF">
      <table border="0" cellpadding=2 width="100%">
        <tbody>
          <tr bgcolor="#000099">
            <td bordercolor="#FFFFFF" class="style2">
            <h2>ADOdb Database Abstraction Library for PHP</h2>
            <font size="2">&copy; 2000-2014 John Lim
(jlim#natsoft.com). All rights reserved. </font></td>
            <td align="center" valign="center" bgcolor="#CCCCCC" class="style1"><img src="adodb.gif"></td>
          </tr>
        </tbody>
      </table>
      <p class="style1"> <font size="2">
          <a href="#download">Download</a> &nbsp;
          <a href="https://github.com/ADOdb/ADOdb">Source code</a> &nbsp;
          <a href="#docs">Documentation</a> &nbsp;
          <a href="#support">Support</a> &nbsp;
          <a href="docs-adodb.htm#changelog">Changelog</a>&nbsp;
          <a href="adodb-faq.html">FAQ</a> </font></p>
      <hr>
      <p class="style1">ADOdb is a database abstraction library for PHP</p>
      <p class="style1">It currently supports an amazing number of
databases, thanks to the wonderful ADOdb community: <i>MySQL,
PostgreSQL, Interbase, Firebird, Informix, Oracle, MS SQL, Foxpro,
Access, ADO, Sybase, FrontBase, DB2, SAP DB, SQLite, Netezza, LDAP, </i>and<i>
generic ODBC, ODBTP</i>. The Sybase, Informix, FrontBase and
PostgreSQL, Netezza, LDAP, ODBTP drivers are community contributions.
Here is the <a href="docs-adodb.htm#drivers">complete
list of drivers</a>. </p>
      <p class="style1"> Many popular web applications such as
      <a href="http://www.andrew.cmu.edu/%7Erdanyliw/snort/snortacid.html">ACID</a>,
      <a href="http://community.zikula.org">Zikula/PostNuke</a>,
      <a href="http://phpwiki.sourceforge.net/">phpWiki</a>,
      <a href="http://www.mamboserver.com/">Mambo</a>,
      <a href="http://phpgacl.sourceforge.net/">PHP GACL</a>,
      <a href="http://sourceforge.net/projects/tikiwiki">TikiWiki</a>,
      <a href="http://www.egroupware.org/">eGroupWare</a> and
      <a href="http://phplens.com/lens/">phpLens App Server</a>
      are using ADOdb as their database abstraction layer.

      Some reasons why ADOdb is popular include: </p>
      <ul class="style1">
        <li>Designed for <b>speed</b>. It is probably the fastest open
source database abstraction library available for PHP. See <a
 href="http://phplens.com/lens/adodb/">benchmarks</a>.</li>
        <li>Provides <b>extensive portability support</b> such as date
and type-handling and portable schema creation. See <a
 href="tips_portable_sql.htm">portable sql tips</a></li>
        <li>Support many <b>enterprise features</b> such as database
backed sessions (with session expiry notification), SQL code
generation, pivot tables, SELECT LIMIT emulation for all databases,
performance monitoring.</li>
        <li><b>Easy to learn</b>, especially if you have Window's
programming experience, as it uses many ADO conventions.</li>
        <li><b>Extensive QA</b>, every release is unit-tested on
Access, MySQL, PostgreSQL, MS SQL, Oracle 11g.</li>
        <li><b>Mature</b>, continiously developed since August 2000.
Has a <b>large community</b> of users. </li>
        <li>Powerful <strong>Active Record </strong>support. See <a href="docs-active-record.htm">docs</a>. </li>
        <li>Very <b>reasonable licensing</b> terms (BSD). This means
that you can incorporate (and even compile) it into your software
applications<b> royalty-free</b> without asking the author's
permission, provided you include license.txt in your release. Also
dual-licensed (Lesser GPL). </li>
      </ul>


      <h3 class="style1">PHP Code Samples</h3>

      <pre>include('/path/to/adodb.inc.php');<br>$DB = NewADOConnection('mysql');<br>$DB-&gt;Connect($server, $user, $pwd, $db);<br><br><font
 color="#006600"># M'soft style data retrieval with binds</font>
$rs = $DB-&gt;Execute("select * from table where key=?",array($key));
while (!$rs-&gt;EOF) {
    print_r($rs-&gt;fields);
    $rs-&gt;MoveNext();
}

<font color="#006600"># PEAR style data retrieval</font>
$rs = $DB-&gt;Execute("select * from table where key=123");
while ($array = $rs-&gt;FetchRow()) {
    print_r($array);
}

<font color="#006600"># Alternative URI connection syntax:</font>
$DB = NewADOConnection("<b>mysql://$user:$pwd@$server/$db?persist</b>");<br><br><font
 color="#006600"># No need for Connect or PConnect when using URI syntax</font>

$ok = $DB-&gt;Execute("update atable set aval = 0");
if (!$ok) mylogerr($DB-&gt;ErrorMsg());
      </pre>

      <p class="style1">Other things you can try include: </p>
      <pre><font color="#006600"># Updating tables</font>
$ok = $DB-&gt;Execute("update table set col1=? where key=?",array($colval, $key));

<font color="#006600"># retrieving data shortcuts</font>
$val = $DB-&gt;GetOne("select col from table where key='John'");
$row = $DB-&gt;GetRow("select col from table where key='John'");
$arr = $DB-&gt;GetAll("select col from table");
$arr = $DB-&gt;GetAssoc("select key,col from table"); # returns associative array $key=&gt;col

<font color="#006600"># Retrieve high speed cached recordsets (cached for 3600 secs)<br>
# Cache directory defined in  global $ADODB_CACHE_DIR. <br>
# CacheGetOne, CacheRow, CacheGetAll all work</font>
$rs = $DB-&gt;CacheExecute(3600, "select orgname from users where user='JOHN'");
      </pre>

      <span class="style1">And there are <a href="docs-adodb.htm#coding">more
connection examples</a> showing you how to connect to
      <a href="docs-adodb.htm#sqlite">SQLite</a>,
      <a href="docs-adodb.htm#oci8">Oracle</a>,
      <a href="docs-adodb.htm#postgres">PostgreSQL</a>,
      <a href="docs-adodb.htm#odbc_mssql">Microsoft SQL Server</a>,
      <a href="docs-adodb.htm#access">MS Access</a>,
      <a href="docs-adodb.htm#ldap">LDAP</a>,
      <a href="docs-adodb.htm#ibase">Interbase/Firebird</a>,
      etc.
      </span>

      <h3 class="style1">PHP5 Support</h3>
      <span class="style1">ADOdb has full PHP5 support, including SPL and exception support. For
example, you can do this in PHP5:
      </span>      <pre>$rs = $DB-&gt;Execute("select * from table");<br>foreach ($rs as $row) {<br>    print_r($row);<br>}<br></pre>
      <span class="style1">If you include the following adodb-exceptions.inc.php file, then ADOdb
will throw exceptions when an error occurs:
      </span>      <pre>include("<b>/path/to/adodb-exceptions.inc.php</b>");<br>include("/path/to/adodb.inc.php");<br>$DB = NewADOConnection('oci8');  <br>$DB-&gt;Connect("", "scott", "tiger");<br>try {<br>   $DB-&gt;Execute("select badsql from badtable");<br>} catch (exception $e) {<br>    print_r($e);<br>}<br></pre>

      <a name="download"></a>
      <h3 class="style1">Download</h3>
      <p class="style1">
          <a href="https://sourceforge.net/projects/adodb/files/adodb-php5-only/">Download from SourceForge</a><br>
      </p>
      <p class="style1"><i>Requirements</i>: PHP 5.0 or later.</p>
      <p class="style1"><i>Installation</i>: Unpack files into a directory. Try the
above sample code, adjusting
the connection parameters to suit your database server, and modify the
sql to match your tables. </p>
      <p class="style1"><i>Debugging</i>: Set your connection's debug property, e.g.
<tt>$DB-&gt;debug=true;</tt> if you are having problems. It will output lots of
useful status and
error messages.</p>

      <a name="docs"></a>
      <h3 class="style1">ADOdb Documentation</h3>
      <p class="style1"><a href="docs-adodb.htm">One HTML Page</a>
      </p>

      <p class="style1">
        <a href="docs-datadict.htm">Data Dictionary</a> for schema creation.<br>
        <a href="docs-perf.htm">Performance Monitoring</a>.<br>
        <a href="docs-session.htm">Database-backed Session Management</a>.
      </p>

      <h4 class="style1">Other Docs for PHP version</h4>
      <p class="style1">
        The documents in this section are maintained (or not, as the case may be)
        by their respective authors and are therefore potentially out of date
        or even obsolete.
      </p>

      <p class="style1">
        <a href="tute.htm">MySQL Tutorial</a><br>
        <a href="docs-oracle.htm">Advanced Oracle Tutorial</a><br>
        <a href="tips_portable_sql.htm">Portable SQL Tips with ADOdb</a><br>
        <a href="docs-active-record.htm">ADOdb Active Record</a>, an OOP encapsulation of a database record.</br>
      </p>

      <p class="style1">A couple excellent articles by icarus about ADOdb at MelonFire: </p>
      <p class="style1"> &nbsp; &nbsp;
        <a href="http://www.melonfire.com/community/columns/trog/article.php?id=142">Part 1 on Basics</a> and
        <a href="http://www.melonfire.com/community/columns/trog/article.php?id=144">Part 2 on Advanced ADOdb</a>.
      </p>

      <h4 class="style1">Translations</h4>
      <p class="style1">PHP documentation in other languages: </p>
      <ul class="style1">
        <li><a
 href="http://phplens.com/lens/adodb/ADODB-Manual-Korean.htm">Korean</a></li>
        <li><a href="http://www.lacorona.com.mx/fortiz/adodb/">Spanish (Castellano)</a> </li>
 <li><a href=http://www.souken.co.jp/tech/php/adodb/docs-adodb-ja.htm>Japanese</a>
      </ul>
      <p class="style1">and tutorials in: </p>
      <ul class="style1">
        <li><a href="http://www.ifin.net.tw/adodb/adodb_tutorial.htm">Chinese</a><br></li>
        <li><a href="http://phplens.com/phpeverywhere/adodb_french">Francais</a><br></li>
        <li><a href="http://phplens.com/phpeverywhere/adodb_german">German</a><br></li>
        <li><a href="http://phplens.com/phpeverywhere/adodb_italian">Italian</a><br></li>
        <li><a href="http://phplens.com/adodb/adodb_tutorial_pl.html">Polish</a><br></li>
        <li><a href="http://www.lacorona.com.mx/fortiz/adodb/tute-es.htm">Spanish (Castellano)</a></li>
        <li><a href="http://www.exzilla.net/docs/adodb/adodb-mysql-tutorial.php">Thai</a><br></li>
      </ul>

      <a name="support"></a>
      <h3 class="style1">Support</h3>
      <p class="style1">Bug reports, feature requests and questions should be filed on
        <a href="https://github.com/ADOdb/ADOdb/issues">Github</a>.
      </p>
      <p class="style1">The legacy
        <a href="http://phplens.com/lens/lensforum/topics.php?id=4">ADOdb forums</a>
        are still available, however they are not actively monitored and should
        only be used as reference.
      </p>
      <hr>
      <span class="style1">&copy; 2000-2014 John Lim. All Rights Reserved.
        <strong>Contact:</strong> jlim#natsoft.com <br>
      </span></td>
    </tr>
  </tbody>
</table>
</body>
</html>
